/*
编写 : Hexh
时间 : 2012-6-15 9:02:48
*/
using System;
using System.Collections.Generic;
using FSBS.Core.Entity;
using FSBS.Core.Entity.IRespositories;
using HMIS.FrameWork;
using HMIS.FrameWork.DomainBase;

namespace FSBS.Facade.Impl
{
	/// <summary>
	///	 the impl of IFsbsQmInvtFacade
	/// </summary>
	public class FsbsQmInvtFacadeImpl : IFsbsQmInvtFacade
	{

		private readonly IFsbsQmInvtRepository FsbsQmInvtRepository;

		public FsbsQmInvtFacadeImpl(IFsbsQmInvtRepository FsbsQmInvtRepository)
		{
			this.FsbsQmInvtRepository = FsbsQmInvtRepository;
		}

		#region IFsbsQmInvt Entity Save,Get,Update,Delete

		public FsbsQmInvt Get(string id)
		{
			return FsbsQmInvtRepository.Get(id);
		}

		public FsbsQmInvt Load(string id)
		{
			return FsbsQmInvtRepository.Load(id);
		}

		public string CreateNewInventory(string deptId, string type, string userId)
		{
			return this.FsbsQmInvtRepository.CreateNewInventory(deptId, type, userId);
		}

		public void SaveOrUpdate(FsbsQmInvt entity)
		{
			this.FsbsQmInvtRepository.SaveOrUpdate(entity);
		}

		public void Delete(string id)
		{
			FsbsQmInvtRepository.Delete(id);
		}
		
		public void PhysicsDelete(string id)
		{
			FsbsQmInvtRepository.PhysicsDelete(id);
		}

		public bool IsFieldExist(string fieldName, string fieldValue, string id)
		{
			return FsbsQmInvtRepository.IsFieldExist(fieldName, fieldValue, id);
		}
		
		public bool IsFieldExistWhere(string fieldName, string fieldValue, string id, string where)
		{
			return FsbsQmInvtRepository.IsFieldExistWhere(fieldName, fieldValue, id, where);
		}
		
		#endregion
		
		#region Query 

		public IList<FsbsQmInvt> GetAll()
		{
			return FsbsQmInvtRepository.GetAll();
		}

		public IList<FsbsQmInvt> GetPlist(string deptId, string type, string state, int start, int limit, string sort, string dir, List<DataFilter> filters, out long total)
		{
			return FsbsQmInvtRepository.GetPlist(deptId, type, state, start, limit, sort, dir, filters, out total);
		}

		public IList<FsbsQmIvls> GetCarPlist(string inventoryId, int start, int limit, string sort, string dir, List<DataFilter> filters, out long total)
		{
			return FsbsQmInvtRepository.GetCarPlist(inventoryId, start, limit, sort, dir, filters, out total);
		}
		
		#endregion
	}
}
